<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Table</title>
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
</head>
<body>
<div id="app">
    <!-- :data 双向绑定vue中的data的tableData，相当于v-for的会遍历集合-->
    <el-table :data="tableData" border style="width: 100%">
        <!--lable：列名，prop：vue中名为data的实际的参数，下同-->
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址">
        </el-table-column>
    </el-table>
</div>

<script>
    // Vue首字母大写
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1518 弄'
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1517 弄'
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1519 弄'
                }, {
                    date: '2016-05-03',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1516 弄'
                }]
            }
        },
        //没有编译完的时候发送请求
        created() {
        },
        //编译完的时候发送请求
        mounted() {
        },
        methods: {
            //定义方法的地方
        }
    });
</script>
</body>
</html>
